#include <iostream>
#include <algorithm>
#include <cstring>

using namespace std;
void mul(int a[][2], int b[][2], int c[][2])
{
    int temp[2][2] = {{0, 0}, {0, 0}}; //一定要赋初始值 要不会有奇奇怪怪的答案
    for (int i = 0; i < 2; i++)
        for (int j = 0; j < 2; j++)
            for (int k = 0; k < 2; k++)
                temp[i][j] += a[i][k] * b[k][j];
    memcpy(c, temp, sizeof temp);
}
int f_final(int n)
{
    int x[2] = {1, 1}; // 第二项 的值为前几项为1 2 3 5....
    int t[2][2] = {{1, 1}, {1, 0}};
    int res[2][2] = {{1, 0}, {0, 1}};
    int k = n - 1;
    while (k)
    {
        if (k & 1)
            mul(res, t, res);
        mul(t, t, t);
        k >>= 1;
    }
    int c[2] = {0, 0};
    for (int i = 0; i < 2; i++)
        for (int j = 0; j < 2; j++)
        {
            int r = c[i] + x[j] * res[j][i];
            c[i] = r;
        }
    return c[0];
}
int main()
{
    int n;
    cin >> n;
    cout << f_final(n) << endl;

    return 0;
}